<?php
	/**
	 * Home模块的indexAction。
	 *
	 **/
class IndexAction extends Action
{
	public function index(){
		$this->image_scroll();
		//$this->new_notice();
		$this->new_notice();
		$this->consultingreview();
		$this->cargo_agent();
		$this->finance();
		$this->port();
		$this->advertise();
		$this->display();
	}
	public function login(){
		$this->display("login");
	}
	public function new_notice(){
		$this->model = M("Bulletins");
		$notice_list = $this->model->where("state=1")->order("id desc")->select();
		$this->assign("notice_list",$notice_list);
	}
	public function consultingreview(){
		$model_arr = array(
							"LogisticsDynamicPorts","WaterwayDynamicCargos",
							"CustomsDynamic","EconomyAndTrade",
							"PolicyInterpretation","AirportEnterpriseInformation"
						);
		$model = M("LogisticsDynamicPorts");
		$logistics_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("logistics_list",$logistics_list);
		
		$model = M("WaterwayDynamicCargos");
		$waterway_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("waterway_list",$waterway_list);

		$model = M("CustomsDynamic");
		$custom_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("custom_list",$custom_list);
		
		$model = M("EconomyAndTrade");
		$economy_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("economy_list",$economy_list);
		
		$model = M("PolicyInterpretation");
		$policy_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("policy_list",$policy_list);
		
		$model = M("AirportEnterpriseInformation");
		$airport_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("airport_list",$airport_list);
		}
		
	public function cargo_agent(){
		$model = M("CargoAgent");
		$agent_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("agent_list",$agent_list);
	}
	public function finance(){
		$model = M("IndustryNews");
		$news_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("news_list",$news_list);
	}
	public function port(){
		$model = M("FileManage");
		$port_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("port_list",$port_list);
	}
	public function advertise(){
		$model = M("AdvertisingInformationAirline");
		$ad_list = $model->where("state=1")->order("id desc")->limit(10)->select();
		$this->assign("ad_list",$ad_list);
	}
	public function image_scroll(){
		$model = M("PortInfoImages");
		$list = $model->where("state=1")->order("id desc")->select();
		$this->assign("pics",$list);
	}

}
?>
